/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package controllers;

import java.util.HashMap;
import java.util.List;
import models.Diagnosis;
import play.mvc.Controller;

/**
 *
 * @author Administrator
 */
public class Diagnosiss extends Controller{
	
	 public static void index() {
	        render();
	    }
                 
          /**
     * Get expert json.
     */
    public static void json(int page, int pagesize) {
    	
    	List<Diagnosis> appraiseTypes = Diagnosis.all().fetch(page, pagesize);      	 
    	long total = Diagnosis.count();
    	
    	HashMap<String,Object> obj = new HashMap<String,Object>();
    	obj.put("Rows", appraiseTypes);
    	obj.put("Total", total);
    	renderJSON(obj);
    }


    /**
     * Update a dept.
     */
    public static void save(Diagnosis diagnosis) { 
      
        diagnosis.save();
        renderJSON("");
    }
    
    /**
     * Delete a dept.
     */
    public static void delete(long id) {
       
        Diagnosis.findById(id)._delete();
        renderJSON("");
    }
    
}
